Server selection for routing content to a client using application layer redirection

ABSTRACT

In one embodiment, a first request is received for a probe link from a client that has downloaded a page. The request is received from an application. A test may be performed to determine a server that could optimally service a content request from the client. After receiving the request, the content router sends a re-direct to the client where the re-direct causes the client to follow the re-direct to the server. The server then sends a re-direct back to the client, which the client follows by sending a second request to the content router. The second request is associated with the client and the round-trip time is calculated for the server. It is then determined if the location for the server should be designated as the content deliverer to the client based on the calculated round-trip time.

TECHNICAL FIELD

Particular embodiments generally relate to content delivery systems.

BACKGROUND

A content delivery network (CDN) is a distributed network of content delivery nodes. The content delivery nodes serve content to one or more clients requesting the content. The content delivery nodes are usually dispersed across many geographical locations. For example, one node may be located in New York and another may be located in San Francisco.

If a large multimedia file is downloaded, choosing a non-optimal location to serve the content may lead to a large penalty of content delivery. For example, a large amount of data will have to be transported across more network links. This may cause delay in serving the content to the user. For example, if a user is in San Francisco and the New York server is selected, additional latency may be experienced than if the server in San Francisco was selected and the content will have to be transported all the way from New York to San Francisco unnecessarily, thereby causing inefficient utilization of Service Provider networks.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts an example of a system for delivering content according to one embodiment.

FIG. 2 depicts an example of a page that can be downloaded by a browser of client 104 according to one embodiment.

FIG. 3 provides a more detailed example of a data flow in the system according to one embodiment.

FIG. 4 depicts a simplified flowchart of a method for determining content routing decisions according to one embodiment.

DETAILED DESCRIPTION OF EMBODIMENTS Overview

Particular embodiments generally relate to determining a server for delivering content.

In one embodiment, a first request is received for a probe link from a client that has downloaded a page. The request is received from an application. A test may be performed to determine a server that could optimally service a content request from the client. For example, round trip times are calculated for different servers, and the round trip time determined to be the most optimal for the client is selected. After receiving the request, the content router sends a re-direct to the client where the re-direct causes the client to follow the re-direct to the server. The server then sends a re-direct back to the client, which the client follows by sending a second request to the content router. The second request is associated with the client and the round-trip time is calculated for the server. For example, the round trip time is based on a time when the re-direction link was sent and the second request is received. It is then determined if the location for the server should be designated as the content deliverer to the client based on the calculated round-trip time. For example, multiple locations are tested and the location with the lowest round trip time may be selected as the content deliverer.

Particular embodiments use application layer re-direction to determine a server. For example, a hypertext transfer protocol (HTTP) re-direction is used to cause the client to send a re-direct to the server. The server then responds to the re-direction, which then causes the client to send a second request back to the server. Accordingly, an application layer solution is provided that can measure the round-trip time and determine a location that may be optimal to deliver content to the user.

Example Embodiments

FIG. 1 depicts an example of a system 100 for delivering content according to one embodiment. As shown, a content router 102, a client 104, and a plurality of servers 106 are provided. Servers 106 may be found in various locations 108, which may be geographically dispersed.

Content router 102 is configured to determine a location 108 that should be the content deliverer for client 104. Content router 102 is a device that intercepts client requests directed at a CDN (Content Delivery Network). It is the job of the content router to ensure that content is fetched from a server in a location that is optimal with respect to the client. For example, a closest location to client 104 may be selected. Although the closest location is described, it will be understood that other factors may be used to determine which server 106 is the optimal server to deliver content to client 104. For example, a server 106 may be closest to client 104, but a network to deliver the content from the location may be experiencing low bandwidth throughput or may have failed. Thus, another server 106 that is not the closest but can deliver the content faster may be determined as the optimal server to deliver the content.

Servers 106 may be any devices that can deliver content. For example, servers 106 can include network devices that can deliver content to client 104. In one example, content may be replicated on servers 106 in different locations 108 in a content delivery network. Depending on location 108, content may be delivered with different latencies to client 104. For example, it is expected that a server 106 that is closest to client 104 may be able to deliver the content the fastest to client 104. Also, other factors may be taken into account, such as the bandwidth available for the network, network failures, etc.

Client 104 includes a computer that may be using a browser to download pages, such as web pages. The web page may be a portal that allows a user to download content. When the user requests content, client 104 may send a request to content router 102.

Location 108 may include multiple servers 106. For example, location 108 may be a server farm or data center that includes multiple routers that can deliver content. The description describes using a server to determine a round trip time. The server may be determined as a representative of location 108 and is used as a basis for determining the round trip time. It will be understood that when the content is delivered, any server in the chosen location may be used.

As will be described below, a server determiner 110 may have already selected a location 108 that should deliver content to client 104 before the user requests the content. This decision may be determined in advance of a user requesting the content.

Server determiner 110 uses an application layer solution that can determine a location 108 to deliver the content to client 104. As will be described in more detail below, an application of client 104 may send a request for a probe link to content router 102. Content router 102 then selects a server 106 for a location 108. A server determiner 110 may then send a re-direction request, such as a hypertext transfer protocol (HTTP) re-direct to client 104. This causes client 104 to re-direct the message to a server 106. Server 106 then sends a re-direct back to the client, which causes the client to send a second request to content router 102. Server determiner 110 can then determine the round-trip time it took for the messages to be sent and received. From that, server determiner 110 may determine if server 106 should be selected to deliver content. For example, the above process may be performed for a number of servers 106 in multiple locations 108. The server 106 that has the lowest round-trip time may be selected as the content deliverer. Other factors may be taken into account, such as bandwidth, to determine a server 106 to deliver content the fastest.

FIG. 2 depicts an example of a page 200 that can be downloaded by a browser of client 104 according to one embodiment. Although page 200 is shown, it will be understood that any page may be downloaded by client 104. In one example, page 200 may be a portal that lists content that can be played by the user. As shown, buttons 202 are provided that allow a user to play content 204. In this case, different movies may be played. When a user selects button 202, the user expects that the content should be played almost immediately. For example, the user may expect that content should be played within 2 seconds. If a delay occurs in starting the content, the user may become disinterested and cancel the download.

After a user chooses an item to play, depending on the type of uniform resource locator (URL) that points to the content, an HTTP GET or real-time streaming protocol (RTSP) DESCRIBE is generated by a client application of client 104. The request goes to content router 102 and content router 102 re-directs client 104 to the appropriate server 106. To minimize latency experienced by the user, the content routing decision is made in advance, before the play request is received. Thus, instead of waiting for the play request (either the HTTP GET or RTSP DESCRIBE), the content routing decision may be performed when page 200 is first loaded on a browser of client 104. In one case, the content delivery network does not know when a portal page is downloaded, which means content router 102 does not know when the page is loaded. However, the page may include probe links 106 within it. The probe links point to content router 102 such that it is contacted when the page is loaded.

Probe links 206 may be links that cause client 104 to send a request for a probe link to content router 102. Probe links 206 may be rendered as images or can be invisible (e.g, by having the image be a single pixel or by having an image with a single color that is the same color as the page background). For example, when an image is downloaded in page 200, it causes an application to send a request for a probe link to be sent to content router 102. For example, the probe link may be an HTTP request that is sent. Also, the probe links may be invisible and embedded in code for page 200. When the code is downloaded, a probe link request may be sent to content router 102.

While the user is browsing page 200 by looking at the content selections, content router 102 may determine the content routing decision in the background. By the time the user selects an item to play, it is possible that content router 102 has made a content routing decision, such as content router 102 may have selected a server 106 to deliver content to client 104. For example, content router 102 may have paired the user's Internet protocol (IP) address with a location 108. The mapping between client 104 and location 108 may be saved in a database. When the request is received, client 104 can be re-directed to location 108 to request the content. This allows a server 106 at the location to deliver content to client 104 in a low latency environment.

Although page 200 is described, a user may access content in other ways. For example, a user may select a media link that was received by email. In this case, the link (URL) may point directly to the content file. When content router 102 receives this URL from a client 104 that it has never seen before, a sequence of redirections are triggered to find out the optimal server 106. Once the server is determined, the content is served from the optimal location and all subsequent requests from the same client can now be redirected to the same location. Content router 102 pairs up client 104 with a location 108 and records this mapping in its database for future requests. Future requests from client 104 do not need to go through the server determination process because a database lookup is used to determine the optimal location 108. The database entries may be invalidated after a configured time interval, after which content router 102 goes through the same determination again for the same client.

FIG. 3 provides a more detailed example of a data flow in system 100 according to one embodiment. The following process may be performed for multiple servers 106 in multiple locations 108. As shown at 300, client 104 may download a page 200. The probe links are downloaded as part of the page 200. At 302, a request for the probe link is sent to content router 102. In one example, requests for multiple probe links may be sent. For example, probe links for three locations may be sent to content router 102. In one example, the probe link may be an HTTP request, such as HTTP address contentrouter/probe. This may send a request for a probe link to content router 102. Server determiner 110 may store an identifier or IP address for client 104. This is later used to associate a second request received from client 104 for determining the round trip time.

At 304, content router 102 determines a location 108 to test and determines a server 106 as a representative. Content router 102 then sends a re-direction message to client 104 that re-directs the client to the selected server 106. For example, an HTTP re-direct, such as status code 307, is sent to client 104. A location field in the re-direct may contain a special uniform resource identifier (URI) that points to a server 106 that is to be probed. This causes client 104 to initiate an HTTP connection with that server 106. It should be noted that the re-direction is an HTTP request from content router 102 to client 104. This may be different than a ping, which might not always work. This is because a client may be behind a firewall and a naked ping from client 104 to content router 102 may not pass through the firewall. Rather, the ping is sent through a port that may not allow the ping. However, an HTTP re-direction to the client in response to the request probe link will pass through the firewall. The ping program depends on Internet control messaging program (ICMP) echo requests to determine round-trip times. A number of Internet Service Providers filter out ICMP echo requests at their boundaries. Particular embodiments use application layer protocol mechanisms such as HTTP or RTSP redirects, thus the requests can pass through unfiltered.

Also, with regard to firewalls, the requests are initiated by client 104 and the firewalls are required not to block the rest of the transaction. The redirect sequence is triggered by client 104 requesting for a probe link and the client establishes a transfer control protocol (TCP) connection with content router 102 and makes a request. The response (a redirect command) from content router 102 to client 104 is passed through to client 104 on the same TCP connection. Firewalls recognize the redirect command as part of the same TCP transaction and let the redirect pass. The redirections from servers 106 are also recognized and passed.

The re-direct causes client 104 to follow the re-direct and initiate an HTTP connection with server 106 at 306. For example, the re-direct sent to client 104 is re-directed to server 106-1. Server 106-1 detects the special URI, which causes it to send a re-direct back to client 104 at 308. This re-direct is followed back to content router 102. For example, client 104 may send an HTTP message: contentrouter/probe to content router 102. This process may be performed for all probe links that are requested. For example, server 106-2 and server 106-3 may also be probed with the above probing of server 106-1. Content router 102 associates an identifier with client 104 and can then calculate the round trip time using a time based on when a previous message was sent. In one example, a round-trip time for each server 106 is calculated. The time elapsed from the initial re-direct at 304 to when the second request from client 104 is received at 310 may be calculated. This may measure the round-trip time between server 106 and client 104. This round-trip time may include the time it took to send the messages from content router 102 to client 104 and from client 104 to content router 102. However, assuming that this time is the same for all servers 106, then it can be included in the calculation.

When multiple locations 108 have been tested, server determiner 110 may then determine an optimal server 104 (or location) to assign as the content deliverer. For example, a location that server determiner 110 determines to be a location that can deliver the content the fastest to client 104 is determined. Different round trip times for servers 106 may be compared and the most optimal location is determined based on the round trip times. A location 108 with the least round-trip time may be determined as the location that should be selected to deliver content to client 104.

In some cases, the optimal location may be better indicated by bandwidth than latency. The bandwidth may be measured by having the probe links point to a dummy HTML file of a suitable size. Over a high bandwidth path, the file will download faster causing a corresponding location 108 to provide a download faster. However, server 106 cannot respond to a GET request by issuing both a 200 OK and a 307-re-direct. Thus, an alternative mechanism to re-direct client 104 back to content router 102 after the probe file has been transferred may be needed. In one example, the probe link on the portal page would be <iframe src=“http://contentrouter/probe.html”><iframe>. When client 104 requests for probe.html from content router 102, it is re-directed to the HTTP address server-in-location1/dummy.html. This file, located on the server 106, may be:

<html> <body> <!-- Invisible dummy data. Fill to the desired size... ... ... --> <img src=“http://contentrouter/probe.jpg”></img> </body> </html>

When the file is requested for, the HTTP response from servers uses standard header fields to prevent caching of content. For example, an HTTP response from server 106 has a Cache-Control field set to no-Cache such that dummy.html is not cached anywhere. Loading the above file causes client 104 to contact the content router to request probe.jpg. At this time, content router 102 can compute the round-trip time, which includes the download time for dummy.html.

The probing process may be performed in series or in parallel. For the series process, client 104 may request the probe links in series. For example, once one round-trip has been completed, a second request for a probe link may be sent. If the requests are sent in parallel, the first response from server 106 may be considered to have the least round-trip time, and thus this server 106 may be selected as the server to deliver content to client 104. There is no need to wait for the rest of the locations to finish the race. Thus, the time required to make a content routing decision is minimized.

In the sequential embodiment, only one probe link may be provided on page 200. Content router 102 may probe servers 106 one-by-one by re-directing the same request for the probe link multiple times. When there are many locations, this may cause the number of re-directions to go over the maximum number supported by the browser of client 104. Accordingly, multiple probe links may be provided on page 200 to allow for multiple sequential re-directions.

Also to avoid the redirection limit, a single probe link may fan out into multiple probes. This may be achieved by crafting the single probe as an in-line frame. For example, the probe link on the portal page may be <iframe src=“http://contentrouter/probe”></iframe>, and the page at the HTTP address contentrouter/probe may look like

<html> <body> <img src=“http://contentrouter/probe1”></img> <img src=“http://contentrouter/probe2”></img> <img src=“http://contentrouter/probe3”></img> </body> </html>

Thus, loading the portal page results in three probe links being requested by client 104, that is probe 1, probe 2, and probe 3. This also decouples page 200 from the internals of the content deliver network. For example, page 200 does not need to be modified for having a new location to be probed.

When the in-line frame is requested, content router 102 may respond with a page containing probes that point to individual servers 106. This avoids one round-trip from the client to the content router. In this case, the page at HTTP address contentrouter/probe may be:

<html> <body> <img src=“http://server-in-location1/probe”></img> <img src=“http://server-in-location2/probe”></img> <img src=“http://server-in-location3/probe”></img> </body> </html>

Also, probe links may not be used on page 200. In this case, the media request that downloads the page may download probe links, which case the re-direct steps before serving the actual content. The user may experience added latency in this case but only for the first request for the page. RTSP requests may also be ping-ponged using the RTSP re-direct messages.

Client 104 may also go through one or more intermediate proxies before reaching content router 102. If this happens, content router 102 may not be able to determine the IP address of client 104. Content router 102 may believe the request originated at the proxy because the proxy acts like it is client 104. This may not allow content router 102 to reliably identify later requests from client 104 to determine the round-trip time. That is, content router 102 needs to determine when the first request was received from a client and associate it with the second request to determine the round-trip time.

When a proxy is used, content router 102 may service the request for a probe link and generate an identifier for client 104. This identifier may be sent to client 104 in the form of an HTTP cookie. Content router 102 records the content routing decision in its database as a mapping between the identifier and the chosen location 108. The next time client 104 requests content from content router 102, client 104 sends over the cookie, which can be used to perform the database look-up using the identifier. This may provide the location that has been selected for client 104.

FIG. 4 depicts a simplified flowchart 400 of a method for determining content routing decisions according to one embodiment. Step 402 receives a request for a probe link. The probe link may be received from client 104 at content router 102.

Step 404 determines a server 106 in which to measure the round-trip time. For example, a server at a location 108 may be determined.

In step 406, a re-direct request is sent from content router 102 to client 104. The request re-directs client 104 to server 106. Server 106 also sends a re-direction back to client 104 which causes it to send a second request to content router 102. In step 408, content router 102 receives the second request from client 104.

In step 410, content router 102 determines the round-trip time.

This process may be performed for multiple servers. Step 412 determines if more locations 108 should be probed. If so, the process reiterates to step 406 where other re-directs are sent. If more locations 108 do not need to be probed, step 414 determines a location 108 that should be the content deliverer to client 104. This may be the location 108 that is closest to client 104 or may have the most bandwidth.

Particular embodiments provide many advantages. For example, extra latency is not added to a request for content. Rather, the content routing decision is performed before the user requests the content. Also, no layer 3 or layer 4 enhancements are required. Also, no domain name service (DNS) support is needed. Rather, an application layer solution is provided where an application at client 104 initiates the probe link request. By using re-directions, the presence of firewalls is not a problem. This is because content router 102 is responding to a request from client 104.

Although the description has been described with respect to particular embodiments thereof, these particular embodiments are merely illustrative, and not restrictive.

Any suitable programming language can be used to implement the routines of particular embodiments including C, C++, Java, assembly language, etc. Different programming techniques can be employed such as procedural or object oriented. The routines can execute on a single processing device or multiple processors. Although the steps, operations, or computations may be presented in a specific order, this order may be changed in different particular embodiments. In some particular embodiments, multiple steps shown as sequential in this specification can be performed at the same time.

A “computer-readable medium” for purposes of particular embodiments may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, system, or device. The computer readable medium can be, by way of example only but not by limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, system, device, propagation medium, or computer memory. Particular embodiments can be implemented in the form of control logic in software or hardware or a combination of both. The control logic, when executed by one or more processors, may be operable to perform that which is described in particular embodiments.

Particular embodiments may be implemented by using a programmed general purpose digital computer, by using application specific integrated circuits, programmable logic devices, field programmable gate arrays, optical, chemical, biological, quantum or nanoengineered systems, components and mechanisms may be used. In general, the functions of particular embodiments can be achieved by any means as is known in the art. Distributed, networked systems, components, and/or circuits can be used. Communication, or transfer, of data may be wired, wireless, or by any other means.

It will also be appreciated that one or more of the elements depicted in the drawings/figures can also be implemented in a more separated or integrated manner, or even removed or rendered as inoperable in certain cases, as is useful in accordance with a particular application. It is also within the spirit and scope to implement a program or code that can be stored in a machine-readable medium to permit a computer to perform any of the methods described above.

As used in the description herein and throughout the claims that follow, “a”, “an”, and “the” includes plural references unless the context clearly dictates otherwise. Also, as used in the description herein and throughout the claims that follow, the meaning of “in” includes “in” and “on” unless the context clearly dictates otherwise.

Thus, while particular embodiments have been described herein, a latitude of modification, various changes and substitutions are intended in the foregoing disclosures, and it will be appreciated that in some instances some features of particular embodiments will be employed without a corresponding use of other features without departing from the scope and spirit as set forth. Therefore, many modifications may be made to adapt a particular situation or material to the essential scope and spirit. 

1. A method comprising: receiving a first request for a probe link from a client that has downloaded a page; determining a server in a location, the location being a location that could service a content request from the client; sending a redirect message to the client, the redirect message causing the client to follow the redirect message to the server and to receive a redirect back to the client; receiving a second request from the client based on the redirect received from the server at the client; associating the second request with the probe link; calculating a roundtrip time for the server; and determining if the location should be designated as a content deliverer to the client based on the calculated roundtrip time.
 2. The method of claim 1, further comprising: calculating a plurality of roundtrip times for a plurality of locations; and determining a location in the plurality of locations as the content deliverer based on the calculated roundtrip times.
 3. The method of claim 1, further comprising: sending a plurality of redirect messages to the client for a plurality of locations; and determining a location in the plurality of locations as the content deliverer based on which second request from a server the location is received first.
 4. The method of claim 1, wherein the redirect message is a redirect message that passes through a client's firewall.
 5. The method of claim 1, wherein the first request is received from an application at the client.
 6. The method of claim 1, wherein the content deliverer is determined before a content request for content is received.
 7. The method of claim 6, further comprising redirecting the client to the determined location when the content request is received.
 8. The method of claim 1, wherein the roundtrip time is based on a time the redirect message is sent to the client and when the second request is received.
 9. The method of claim 1, wherein the redirect message causes a file to be downloaded from the server.
 10. An apparatus comprising: one or more processors; and logic encoded in one or more tangible media for execution by the one or more processors and when executed operable to: receive a first request for a probe link from a client that has downloaded a page; determine a server in a location, the location being a location that could service a content request from the client; send a redirect message to the client, the redirect message causing the client to follow the redirect message to the server and to receive a redirect back to the client; receive a second request from the client based on the redirect received from the server at the client; associate the second request with the probe link; calculate a roundtrip time for the server; and determine if the location should be designated as a content deliverer to the client based on the calculated roundtrip time.
 11. The apparatus of claim 10, wherein the logic when executed is further operable to: calculate a plurality of roundtrip times for a plurality of locations; and determine a location in the plurality of locations as the content deliverer based on the calculated roundtrip times.
 12. The apparatus of claim 10, wherein the logic when executed is further operable to: send a plurality of redirect messages to the client for a plurality of locations; and determine a location in the plurality of locations as the content deliverer based on which second request from a server the location is received first.
 13. The apparatus of claim 10, wherein the redirect message is a redirect message that passes through a client's firewall.
 14. The apparatus of claim 10, wherein the first request is received from an application at the client.
 15. The apparatus of claim 10, wherein the content deliverer is determined before a content request for content is received.
 16. The apparatus of claim 15, wherein the logic when executed is further operable to redirect the client to the determined location when the content request is received.
 17. The apparatus of claim 10, wherein the roundtrip time is based on a time the redirect message is sent to the client and when the second request is received.
 18. The apparatus of claim 10, wherein the redirect message causes a file to be downloaded from the server.
 19. An apparatus comprising: means for receiving a first request for a probe link from a client that has downloaded a page; means for determining a server in a location, the location being a location that could service a content request from the client; means for sending a redirect message to the client, the redirect message causing the client to follow the redirect message to the server and to receive a redirect back to the client; means for receiving a second request from the client based on the redirect received from the server at the client; means for associating the second request with the probe link; means for calculating a roundtrip time for the server; and means for determining if the location should be designated as a content deliverer to the client based on the calculated roundtrip time.
 20. The apparatus of claim 19, further comprising: means for calculating a plurality of roundtrip times for a plurality of locations; and means for determining a location in the plurality of locations as the content deliverer based on the calculated roundtrip times. 